Page({
  getUserProfile({target}) {
    let {number} = target.dataset;
    let userInfo = wx.getStorageSync('userInfo') || [];
    if(userInfo.length !== 0) wx.navigateTo({url: `/pages/game/game?number=${number}`})
    else{
      wx.getUserProfile({
        desc: '存储展示排行用户信息', 
        success: (res) => {
          wx.setStorageSync('userInfo', res.userInfo)
          wx.navigateTo({
            url: `/pages/game/game?number=${number}`,
          })
        },
        fail: () => {
          wx.showToast({
            title: '亲，先登录哦~',
            icon:'error'
          })
        }
      })
    }
  },
})